package com.snailframework.gateway.route;

import org.springframework.cloud.gateway.route.RouteDefinition;
import org.springframework.cloud.gateway.route.RouteDefinitionLocator;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;

import javax.annotation.Resource;

/**
*
* @author: zgadmin(zhangge)
* @Date: 2023/2/23 上午11:15
* @Version: 1.0.0
*/
@RestController
@RequestMapping("/route")
public class RouteController {

    @Resource
    RouteDefinitionLocator routeDefinitionLocator;

    @GetMapping
    public Flux<RouteDefinition> route(){
        return routeDefinitionLocator.getRouteDefinitions();
    }

}